home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
yerk
/
mps231ss.hqx
/
Mops source
/
Toolbox classes
/
Window
< prev
next >
Wrap
Text File
|
1993-02-20
|
2KB
|
79 lines
\ Window class.
\ May 91 mrh Added NonScrollWind.
\ Default grow and drag limits set at grow and drag time.
\ Also fixed a number of long-standing bugs in draw:, enable:, disable:
\ etc. New: deactivates current window. Added PenIntoWind:.
\ July 91 mrh Moved Window class into module WindowMod.
variable THEWINDOW
-1 constant INFRONT
variable THEPORT
129 constant THUMB
0 constant DOCWIND
16 constant RNDWIND
1 constant DLGWIND
0 value ACTW \ Indentifies any active Mops window which
\ should be idled. Will be set zero if we have, say,
\ a dialog as the front window, but NOT if we're
\ switched into the background.
0 value SaveActW \ Saves actW over Suspend-Resume
forward WHRFEV \ Will become where: fEvent
\ ( val -- ) These next words set text characteristics for current grafPort
: TFONT makeInt call TextFont ;
: TFACE makeInt call TextFace ;
: TMODE makeInt call TextMode ;
: TSIZE makeInt call TextSize ;
: INITFONT 9 tsize 4 tfont ( Monaco ) 0 tMode 0 tFace ;
: TBOOL \ ( b -- bool ) Makes a Mops boolean into a Toolbox boolean
$ 100 and makeint ;
\ Save and restore the GrafPort
: SAVEPORT thePort call GetPort ;
: RESTPORT thePort @ call SetPort ;
\ Utility routines for calculating a scroll bar's position.
: >VRECT { left top rt bot -- l' t' r' b' }
rt 15 - top 1- rt 1+ bot 14 - ;
: >HRECT { left top rt bot -- l' t' r' b' }
left 1- bot 15 - rt 14 - bot 1+ ;
from WindowMod import{ WINDOW }
compile: windowMod
\ NonScrollWind is a window that will not scroll. This preserves fprect which we
\ may be using for scrolling text somewhere else.
:class NONSCROLLWIND super{ window }
:m CLASSINIT:
classinit: super false setScroll: self ;m
;class
fWind ' window set_class
classinit: fWind markalive: fWind
true value fWindActive? \ Will be true only when fwind is active.
\ It it set/reset by enFW and disFW (see
\ FEMod.txt).
true setinstall: windowMod